package com.xiaojian.pick.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Data
public class Topic {
    private Integer id;     // 主键
    private String theme;   // 帖子主题
    private String description;     // 帖子说明
    private Integer commentCount;   // 帖子评论数
    private Integer clickCount;     // 帖子点击率
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date publishDate;       // 帖子发布时间
    private Integer state;      // 0，删除状态；1，展示中
    private Integer hotDegree;  // 热门程度：1,2,3

    private User user;     // 帖子发布者
    private List<TopicImg> topicImgList;    // 帖子内图片
    private List<Comment> commentList;      // 帖子的评论列表

    public Topic(Integer id, String theme, String description, Integer commentCount, Integer clickCount, Date publishDate, Integer state, Integer hotDegree, User user, List<TopicImg> topicImgList, List<Comment> commentList) {
        this.id = id;
        this.theme = theme;
        this.description = description;
        this.commentCount = commentCount;
        this.clickCount = clickCount;
        this.publishDate = publishDate;
        this.state = state;
        this.hotDegree = hotDegree;
        this.user = user;
        this.topicImgList = topicImgList;
        this.commentList = commentList;
    }

    public Topic() {
    }

    @Override
    public String toString() {
        return "Topic{" +
                "id=" + id +
                ", theme='" + theme + '\'' +
                ", description='" + description + '\'' +
                ", commentCount=" + commentCount +
                ", clickCount=" + clickCount +
                ", publishDate=" + publishDate +
                ", state=" + state +
                ", hotDegree=" + hotDegree +
                ", user=" + user +
                ", topicImgList=" + topicImgList +
                ", commentList=" + commentList +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTheme() {
        return theme;
    }

    public void setTheme(String theme) {
        this.theme = theme;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(Integer commentCount) {
        this.commentCount = commentCount;
    }

    public Integer getClickCount() {
        return clickCount;
    }

    public void setClickCount(Integer clickCount) {
        this.clickCount = clickCount;
    }

    public Date getPublishDate() {
        return publishDate;
    }

    public void setPublishDate(Date publishDate) {
        this.publishDate = publishDate;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getHotDegree() {
        return hotDegree;
    }

    public void setHotDegree(Integer hotDegree) {
        this.hotDegree = hotDegree;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public List<TopicImg> getTopicImgList() {
        return topicImgList;
    }

    public void setTopicImgList(List<TopicImg> topicImgList) {
        this.topicImgList = topicImgList;
    }

    public List<Comment> getCommentList() {
        return commentList;
    }

    public void setCommentList(List<Comment> commentList) {
        this.commentList = commentList;
    }
}